package com.GUI.Lesson04;

import javax.swing.*;
import java.awt.*;

public class JFrameDemo02  {

    public static void main(String[] args) {
        new MyJFrame2().init();
    }
}
class MyJFrame2 extends JFrame{
    public void init(){
        Container contentPane = this.getContentPane();
        //ontentPane.setBackground(Color.blue);
        this.setVisible(true);
        this.setBounds(5,5,200,300);
        JLabel label = new JLabel("欢迎来到の游戏世界");
        this.add(label);
        //让文本文字居中
        label.setHorizontalAlignment(SwingConstants.CENTER);
    }
}
